# print((int)(4**0.5))
# print(7//2)
# print(-7/2)
import random
import sys


# a=10
# b=10
# print(a<b)
# print(a>b)
# print(a<=b)
# print(a>=b)
# print(a==b)
# print(a!=b)

# a='你好'
# b='温家杰' #中文进行字符串大小比较,无意义
# print(a>b)
# print(a<b)
# print(a<=b)
# print(a>=b)
# print(a==b)
# print(a!=b)

# print(0.1+0.2==0.3)
# print(0.1)
# print(0.2)
# print(0.1+0.2)

# a=0.1+0.2
# b=0.3
# print(-0.0000000001<(a-b)<0.000001)

# a=10
# b=20
# c=30
# print(a<b<c)
# print(a<b and b>c)
# print(a<b or b<c)
# print(a>b or b>c)
# print(not a>b)

# a=10
# b=20
# print(a>b and 10/0==1)
# print(a<b or  10/0==1)

# a,b=10,20  #多元赋值
# a=b=20  #链式赋值
#
# a=10
# b=20
# a,b=b,a
# print(a,b)
# a+=1
# a=a+1
# ++a
# print(a)
#
# a='hello'
# b='world'
# print(a+b) #True=1 False=0
# print(a+b)
# a=10
# b=True

# num=input('请输入一个数字:0或者1->')
# num=int(num)
# if num==1:
#     print("好好学习")
# elif num==0:
#     print("摆烂")
# else:
#     print('输入错误')

# a=input('请输入一个数:')
# b=input('请输入一个数:')
# if a=='1':
#     if b=='2':
#         print('aaa')
#     print('bbb')
# print('ccc')

# a=input('请输入一个整数:')
# a=int(a)
# if a%2==1:
#     print('奇数')
# else:
#     print('偶数')

# a=int(input('请输入一个数:'))
#
# if a>0:
#     print('正数')
# elif a<0:
#     print('负数')
# else:
#     print('为0')

# year=int(input('请输入一个年份'))
#
# if (year%4==0 and year%100!=0) or year%400==0 :
#     print('闰年')
# else:
#     print('非闰年')

# a=int(input("请输入一个整数"))
# if a!=1:
#     pass
# else:
#     print('hello')

# a=1
# while a<=10:
#     print(a)
#     a+=1

# a=1
# sum=0
# while a<=100:
#     sum+=a
#     a+=1
# print(f'sum的值为{sum}')

#5的阶乘
# a=1
# count=1
# while a<=5:
#     count*=a
#     a+=1
# print(f'5的阶乘为:{count}')

# 1!+2!+3!+4!+5!
# a=1
# i=1
# count=1
# sum=0
# while i<=5:
#     while a<=i:
#         count*=a
#         a+=1
#     sum+=count
#     a=1
#     count=1
#     i+=1
# print(f'和为{sum}')

# for i in range(1,11):
#     print(i)
# # range 内建函数 得到一个可迭代对象,里面包含了一系列的整数 range(begin,end) -> [begin,and) 前闭后开
# # 第三个参数表示步长
# for i in range(2,11,2):
#     print(i)
#打印从10-1
# for i in range(10,0):
#     print(i)

# theSum=0
# for i in range(1,101):
#     theSum+=i
# print(theSum)

# for i in range(1,6):
#     if i==3:
#         continue
#     print(f"吃第{i}个包子")

# for i in range(1,6):
#     if i==3:
#         break
#     print(f'吃第{i}个包子')

# theSum=0 #加和的结果
# count=0  #几个数字
# while True:
#     a=input(f'请输入第{count+1}个数字,";"表示输入结束')
#     if a==';':
#         break;
#     else:
#         theSum+=float(a)
#         count+=1
# if(count==0):
#     print('无数字')
# else :
#     print(f'{count}个数字的平均值为{theSum/count}')

# print('+--------------------------+')
# print('|         花有重开日        |')
# print('|         人无再少年        |')
# print('|          欢迎来到         |')
# print('|        人生重开模拟器      |')
# print('+--------------------------+')
#
# #设置初始属性 颜值,体质,智力,家境
# #总和20
#
# while True:
#     print('请设置初始属性,总点数为20')
#     face=int(input('请输入颜值(1-10):'))
#     strong=int(input('请输入体质(1-10):'))
#     iq=int(input('请输入智力(1-10):'))
#     home=int(input('请输入家境(1-10):'))
#     #通过条件语句,对于用户输入的属性值做出检查
#     if face<1 or face>10:
#         print('颜值设置有误')
#         continue
#     if strong<1 or strong>10:
#         print('体质错误')
#         continue
#     if iq<1 or iq>10:
#         print('智力有误')
#         continue
#     if home<1 or home>10:
#         print('家境有误')
#         continue
#     if face+strong+iq+home >20:
#         print('总的属性和超出20,设置有误')
#         continue
#     #此时跳出循环
#     print('初始属性输入完毕')
#     print(f"face:{face} strong:{strong} iq:{iq} home:{home}")
#     break
#
# #生成角色性别
# #使用random.randint(beg,end) 生成一个[beg,end]的数
# point= random.randint(1,6)
# print(f'point={point}')
# if point%2==1:
#     print('你是个男孩')
# else:
#     print("你是个女孩")
#
# #设置角色的出生点 家境+随机数
# point=random.randint(1,3)
# print(f'随机数为{point}')
# if home==10:
#     print('第一档')
#     print('你出生在北京,父母是高官')
#     strong+=1
#     iq+=1
#     face+=1
# elif 7<=home<=9:
#     print('第二档')
#     if point==1:
#         print('你出生在大城市,父母是公务员')
#         face+=2
#     elif point==2:
#         print('你出生在大城市,父母是企业高管')
#         strong+=2
#     elif point==3:
#         print('你出生在大城市,父母是教授')
#         face+=2
# elif 4<=home<=6:
#     print('第三档')
#     if point==1:
#         print('你出生在三线城市,父母是医生')
#         strong+=1
#     elif point==2:
#         print('你出生在镇上,父母是老师')
#         iq+=1
#     else:
#         print('你出生在镇上,父母是个体户')
#         face+=1
# else:
#     print('第四档')
#     if point==1:
#         print('你出生在农村,父母是农民')
#         strong+=1
#         face-=1
#     elif point==2:
#         print('你出生在山里,父母是无业游民')
#         iq-=2
#     else:
#         print('你出生在边远地区,父母是精神病')
#         strong-=2
#         face-=2
#         iq-=2
# print(f"face:{face} strong:{strong} iq:{iq} home:{home}")
# sys.exit(0)


# 定义函数
# def calcSum(beg,end):
#     theSum=0
#     for i in range(beg,end+1):
#         theSum+=i
#     print(f'总和是{theSum}')
#     return 0
#
# #调用函数
# calcSum(1,100)
# calcSum(300,400)
# calcSum(1,1000)

# def Test():
#     print('hello')


# def test(a,b,c,d):
#     print(a+b+c+d)
#
# test(1,2,3,4,)

# def calSum(beg,end):
#     theSum=0
#     for i in range(beg,end+1):
#         theSum+=i
#     return theSum
#
#
#
# print(calSum(1,100))

# def isOdd(num):
#     if num%2==1:
#         return True
#     else:
#         return False
#
# print(isOdd(2))
# print(isOdd(1))

#一个函数返回多个值

# def getPoint():
#     x=10
#     y=20
#     return x,y
# x,y=getPoint()
# print(x,y)

# x=10
# def test():
#     x=20
#     print(f"函数内部{x}")
# test()
# print(f'函数外部{x}')
#
# x=10
#
# def test():
#     print(f'x={x}')
# test()

# x=10
# def test():
#     global x
#     x=20
# test()
# print(f'x={x}')

# for i in range(1,11):
#     print(i)
# if True:
#     x=10
# print(x)

# def test():
#     print('执行代码')
#     print('执行代码')
# print('1111')
# test()

# def isOdd(num):
#     if num%2==0:
#         return False
#     else:
#         return True
# def add(x,y):
#     return x+y
#
# print(isOdd(add(5,5)))